<!DOCTYPE HTML>
<html lang="en">
 <head>
   <!--声明当前页面编码：charset=gbk,gb2312(中文编码),utf-8国际编码-->
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>  
  <title>整句匹配+标签</title>
 </head>
 <body>
  <script type="text/javascript">
    var str="The Rime of the Ancient Mariner";
	var pattern = /^(T.*)$/;
	document.write(str.replace(pattern,"<h1>$1<\h1>"));
  </script>
 </body>
</html>

